package com.zjj2;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.logging.*;

public class JULTest {
    static {
        LogManager logManager = LogManager.getLogManager();
        InputStream asStream = Test2.class.getClassLoader().getResourceAsStream("logging.properties");
        try {
            File file = new File("");
            System.out.println(file.getAbsolutePath());

            logManager.readConfiguration(asStream);

        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
    public static final Logger log = Logger.getLogger(JULTest.class.getName());

    public static void test(String msg) {
        log.fine(log.getClass().getName()+" This is debug message."+msg);

        log.info(log.getClass().getName()+" This is info message."+msg);

        log.warning(log.getClass().getName()+" This is warning message."+msg);
    }

}
